package cn.oa.dao;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.junit.Test;

import java.io.IOException;
import java.io.InputStream;

public class Text {
    @Test
    public void Text() throws IOException {
        String resource="mybatis-config.xml";
        InputStream is=Resources.getResourceAsStream(resource);
        SqlSessionFactory factory=new SqlSessionFactoryBuilder().build(is);
        SqlSession sqlSession=factory.openSession();
        System.out.println("成功");
        sqlSession.close();
    }
}
